﻿#region Using Directives
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.ComponentModel.Design;
using NetROS.Tiers.Entities;
using NetROS.Tiers.Data;
using NetROS.Tiers.Data.Bases;
using NetROS.Tiers.Services;
#endregion

namespace NetROS.Tiers.Web.Data
{
	/// <summary>
	/// Represents the DataRepository.VwNc_Po_DobavljacuProvider object that provides
	/// data to data-bound controls in multi-tier Web application architectures.
	/// </summary>
	[CLSCompliant(true)]
	[Designer(typeof(VwNc_Po_DobavljacuDataSourceDesigner))]
	public class VwNc_Po_DobavljacuDataSource : ReadOnlyDataSource<VwNc_Po_Dobavljacu>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the VwNc_Po_DobavljacuDataSource class.
		/// </summary>
		public VwNc_Po_DobavljacuDataSource() : base(new VwNc_Po_DobavljacuService())
		{
		}

		#endregion Constructors
		
		#region Properties
		
		/// <summary>
		/// Gets a reference to the VwNc_Po_DobavljacuDataSourceView used by the VwNc_Po_DobavljacuDataSource.
		/// </summary>
		protected VwNc_Po_DobavljacuDataSourceView VwNc_Po_DobavljacuView
		{
			get { return ( View as VwNc_Po_DobavljacuDataSourceView ); }
		}
		
		#endregion Properties
		
		#region Methods

		/// <summary>
		/// Creates a new instance of the VwNc_Po_DobavljacuDataSourceView class that is to be
		/// used by the VwNc_Po_DobavljacuDataSource.
		/// </summary>
		/// <returns>An instance of the VwNc_Po_DobavljacuDataSourceView class.</returns>
		protected override BaseDataSourceView<VwNc_Po_Dobavljacu, Object> GetNewDataSourceView()
		{
			return new VwNc_Po_DobavljacuDataSourceView(this, DefaultViewName);
		}
		
		/// <summary>
        /// Creates a cache hashing key based on the startIndex, pageSize and the SelectMethod being used.
        /// </summary>
        /// <param name="startIndex">The current start row index.</param>
        /// <param name="pageSize">The current page size.</param>
        /// <returns>A string that can be used as a key for caching purposes.</returns>
		protected override string CacheHashKey(int startIndex, int pageSize)
        {
			return String.Format("{0}:{1}:{2}", SelectMethod, startIndex, pageSize);
        }
		
		#endregion Methods
	}
	
	/// <summary>
	/// Supports the VwNc_Po_DobavljacuDataSource control and provides an interface for
	/// data-bound controls to perform data operations with business and data objects.
	/// </summary>
	public class VwNc_Po_DobavljacuDataSourceView : ReadOnlyDataSourceView<VwNc_Po_Dobavljacu>
	{
		#region Declarations

		#endregion Declarations
		
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the VwNc_Po_DobavljacuDataSourceView class.
		/// </summary>
		/// <param name="owner">A reference to the VwNc_Po_DobavljacuDataSource which created this instance.</param>
		/// <param name="viewName">The name of the view.</param>
		public VwNc_Po_DobavljacuDataSourceView(VwNc_Po_DobavljacuDataSource owner, String viewName)
			: base(owner, viewName)
		{
		}
		
		#endregion Constructors
		
		#region Properties

		/// <summary>
		/// Gets a strongly-typed reference to the Owner property.
		/// </summary>
		internal VwNc_Po_DobavljacuDataSource VwNc_Po_DobavljacuOwner
		{
			get { return Owner as VwNc_Po_DobavljacuDataSource; }
		}

		/// <summary>
		/// Gets a strongly typed reference to the Provider property.
		/// </summary>
		internal VwNc_Po_DobavljacuService VwNc_Po_DobavljacuProvider
		{
			get { return Provider as VwNc_Po_DobavljacuService; }
		}

		#endregion Properties
		
		#region Methods
		
		#endregion Methods
	}

	#region VwNc_Po_DobavljacuDataSourceDesigner

	/// <summary>
	/// Provides design-time support in a design host for the VwNc_Po_DobavljacuDataSource class.
	/// </summary>
	public class VwNc_Po_DobavljacuDataSourceDesigner : ReadOnlyDataSourceDesigner<VwNc_Po_Dobavljacu>
	{
	}

	#endregion VwNc_Po_DobavljacuDataSourceDesigner

	#region VwNc_Po_DobavljacuFilter

	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilter&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="VwNc_Po_Dobavljacu"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class VwNc_Po_DobavljacuFilter : SqlFilter<VwNc_Po_DobavljacuColumn>
	{
	}

	#endregion VwNc_Po_DobavljacuFilter

	#region VwNc_Po_DobavljacuExpressionBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlExpressionBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="VwNc_Po_Dobavljacu"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class VwNc_Po_DobavljacuExpressionBuilder : SqlExpressionBuilder<VwNc_Po_DobavljacuColumn>
	{
	}
	
	#endregion VwNc_Po_DobavljacuExpressionBuilder		
}

